home *** CD-ROM | disk | FTP | other *** search
/ Nebula 1 / Nebula One.iso / Communications / IBTip / Source / StringResponder.h < prev    next >
Encoding:
Text File  |  1995-06-12  |  757 b   |  27 lines

  1. /* this object will call a specified function whenever
  2.    a registered string is detected in it's input */
  3.  
  4. #import <objc/Object.h>
  5.  
  6. typedef struct elt {
  7.   struct elt *next;       // link for the list
  8.   char *s;                // registered string
  9.   int strlen;             // length of s
  10.   int tag;                // value returned when seen (cannot be zero)
  11.   int matchedChars;       // current length of submatch
  12. } listElt;
  13.  
  14. @interface StringResponder:Object
  15. {
  16.   listElt *list;  // list of registered strings and functions
  17.   int maxlen;     // length of largest registered string
  18. }
  19.  
  20. + new;
  21. - free;
  22. - addString:(char *)string returnValue:(int)tag;
  23. - (int) inputString:(char *)input;   // this is how input is provided
  24. - (int) inputChar:(char)ichar;
  25.  
  26. @end
  27.